import Vue from 'vue'
import VueRouter from 'vue-router'
import { compile } from 'vue-template-compiler'
Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    name: "index",
    component: () => import('../views/home.vue'),

  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home.vue'),
    // redirect: "/home"

  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/user/login.vue')
  },
  {
    path: '/shopcart',
    name: 'shopcart',
    component: () => import('../views/user/shopcart.vue')
  },
  {
    path: '/detail',
    name: 'sort',
    component: () => import('../views/detail.vue'),
    // children: [
    //   {
    //     path: 'shopdetail',
    //     component: () => import('../views/detail/shopdetail.vue')
    //   }
    // ]
  },
  {
    path: '/shopdetail',
    component: () => import('../views/detail/shopdetail.vue')
  },
  {
    path: '/explore',
    name: 'exprore',
    component: () => import('../views/user/explore.vue'),
  },
  {
    path: '/login2',
    name: 'login2',
    component: () => import('../views/user/login2.vue'),
  },
  {
    path: '/shopcart2',
    name: 'shopcart2',
    component: () => import('../views/user/shopcart2.vue')
  },
  {
    path: '/keyboard',
    name: 'keyboard',
    component: () => import('../views/user/keyboard.vue')
  },
  {
    path:"/shopdetail",
    name:'shopdetail',
    component:()=>import("../views/detail/shopdetail.vue")
  },
  {
    path:"/keyboard",
    name:"keyboard",
    component:()=>import("../views/user/keyboard.vue")
  },
  {
    path:"/detailKf",
    name:"detailKf",
    component:()=>import("../views/detailKf.vue")
  },
  {
    path: '/persondetail',
    name: 'persondetail',
    component: () => import('../views/user/persondetail.vue')
  },
]

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes
})

export default router
